﻿using System;

namespace Klinkby
{
    [Serializable]
    public class Tuple<T0, T1, T2, T3, T4, T5, T6, T7> : IEquatable<Tuple<T0, T1, T2, T3, T4, T5, T6, T7>>
    {
        readonly T0 _item0;
        readonly T1 _item1;
        readonly T2 _item2;
        readonly T3 _item3;
        readonly T4 _item4;
        readonly T5 _item5;
        readonly T6 _item6;
        readonly T7 _item7;

        internal Tuple(T0 item0, T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)
        {
            _item0 = item0;
            _item1 = item1;
            _item2 = item2;
            _item3 = item3;
            _item4 = item4;
            _item5 = item5;
            _item6 = item6;
            _item7 = item7;
        }

        public T0 Item0
        {
            get { return _item0; }
        }

        public T1 Item1
        {
            get { return _item1; }
        }

        public T2 Item2
        {
            get { return _item2; }
        }

        public T3 Item3
        {
            get { return _item3; }
        }

        public T4 Item4
        {
            get { return _item4; }
        }

        public T5 Item5
        {
            get { return _item5; }
        }

        public T6 Item6
        {
            get { return _item6; }
        }

        public T7 Item7
        {
            get { return _item7; }
        }

        public bool Equals(Tuple<T0, T1, T2, T3, T4, T5, T6, T7> other)
        {
            if (object.ReferenceEquals(other, null))
                return false;
            return !object.ReferenceEquals(_item0, null)
                ? _item0.Equals(other._item0)
                : object.ReferenceEquals(other._item0, null)
                &&
                !object.ReferenceEquals(_item1, null)
                ? _item1.Equals(other._item1)
                : object.ReferenceEquals(other._item1, null)
                &&
                !object.ReferenceEquals(_item2, null)
                ? _item2.Equals(other._item2)
                : object.ReferenceEquals(other._item2, null)
                &&
                !object.ReferenceEquals(_item3, null)
                ? _item3.Equals(other._item3)
                : object.ReferenceEquals(other._item3, null)
                &&
                !object.ReferenceEquals(_item4, null)
                ? _item4.Equals(other._item4)
                : object.ReferenceEquals(other._item4, null)
                &&
                !object.ReferenceEquals(_item5, null)
                ? _item5.Equals(other._item5)
                : object.ReferenceEquals(other._item5, null)
                &&
                !object.ReferenceEquals(_item6, null)
                ? _item6.Equals(other._item6)
                : object.ReferenceEquals(other._item6, null) &&
                !object.ReferenceEquals(_item7, null)
                ? _item7.Equals(other._item7)
                : object.ReferenceEquals(other._item7, null);
        }
        public override bool Equals(object obj)
        {
            var t = obj as Tuple<T0, T1, T2, T3, T4, T5, T6, T7>;
            return this == t;
        }
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
        public override string ToString()
        {
            return string.Format("({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", _item0, _item1, _item2, _item3, _item4, _item5, _item6, _item7);
        }
    }
}
